/**
 * Copyright (C) 2019-2021 杭州优诗科技有限公司
 *
 * This file is part of UnitSpirit.
 * @author wupingfu
 * @version 1.0.0
 * 
 **/
package com.unitspirit.sample.generics;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.alibaba.fastjson.JSON;

/**
 * @author wupf
 * @category 测试一个方法中多个泛型，签名不同，按顺序读取
 */
public class GenericMutil {

	/**
	 * 
	 */
	public GenericMutil() {
	}

	public int addFun()
	{
		List<String> listStr=new ArrayList<String>();
		
		List<Integer> listInt=new ArrayList<Integer>();
		
		List<Double> listDouble=new ArrayList<Double>();
		
		listStr.add("a");
		listInt.add(1);
		listDouble.add(2d);
		
		System.out.println("listStr:"+JSON.toJSONString(listStr));
		System.out.println("listInt:"+JSON.toJSONString(listInt));
		System.out.println("listDouble:"+JSON.toJSONString(listDouble));
		return 0;
	}
	
	public int delFun(List<String> listStr,List<Integer> listInt,int i)
	{
		return 0;
	}
	public int delFun(int i,Map map)
	{
		List<String> listStr=new ArrayList<String>();
		
		List<Integer> listInt=new ArrayList<Integer>();
		
		List<Double> listDouble=new ArrayList<Double>();
		
		listStr.add("a");
		listInt.add(1);
		listDouble.add(2d);
		
		map.put("2", "b");
		System.out.println("listStr:"+JSON.toJSONString(listStr));
		System.out.println("listInt:"+JSON.toJSONString(listInt));
		System.out.println("listDouble:"+JSON.toJSONString(listDouble));
		System.out.println("map:"+JSON.toJSONString(map));
		return 0;
	}
	
	public static void main(String[] args)
	{
		try {
			Map<String,String> map=new HashMap<String, String>();
			map.put("1", "a");
			GenericMutil cGenericMutil=new GenericMutil();
			cGenericMutil.delFun(1,map);
			
			Map<String,Integer> map2=new HashMap<String, Integer>();
			map2.put("1", 1);
			cGenericMutil.delFun(1,map2);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
